<%@ page language="java" pageEncoding="utf8"%>
<jsp:include page="/head.jsp" />

<script type="text/javascript">
   	dojo.addOnLoad(function(){
   		var bookTicketsAEle =  document.getElementById("a_bookTickets");
   		bookTicketsAEle.className = "active";
   	});
   	
   	function updateBankSelect(select){
   		if(select.value == "cashPay"){
   			document.getElementById("bankSelect").disabled = true;
   		}
   		else{
   			document.getElementById("bankSelect").disabled = false;
   		}
   	}
   	
   	function orderSubmit(){
   	
   		var href = "seatsSelect.do?method=getSessionInfo&sessionId="+this.sessionId;
		ajaxRequest(href, this.loadSessionInfo, null);
   		if(document.getElementById("payMethodSelect").value=="cashPay"){
   			window.location.href = "bookingSuccess.jsp?idcard="+document.getElementById("idCard").value;
   		}
   		else{
   			window.location.href = "bank/bank1.jsp?amount=<%=request.getAttribute("amount")%>";
   		}
   		
   	}
   
</script>
<!-- main content -->
<div class="maincontent">
	<div class="HackBox"></div>
	<div id="breadcrumb">
		&nbsp;
		<a href="index.jsp">网上订票</a>
	</div>
	<div class="maincontentin">
		<div class="register_div">
		<span class="register_bar"> <span class="left"></span> <span
				class="register_icon"> 选择支付 </span> </span>
				<table class="register_table">
					<tbody>
					<tr></tr>
					<tr>
						<td width="30%" style="text-align:right;padding-right:10px;">
							请选择缴费方式:
						</td>
						<td width="30%">				
							<select id="payMethodSelect" name="Postion" style="width:150px" onchange="updateBankSelect(this)" >
								<option>----请选择----</option>
								<option value="bankPay" selected>银行卡支付</option>													
								<option value="cashPay">柜台支付</option>	
							</select>
						</td>
						<td width="30%">
							请选择网上支付或现金支付
						</td>
					</tr>	
					<tr>
						<td width="30%" style="text-align:right;padding-right:10px;">
							请选择银行:
						</td>
						<td id="bankTd" width="30%">
							<select id="bankSelect" name="Postion" style="width:150px">
								<option>----请选择----</option>
								<option>工商银行</option>
							</select>			
						</td>	
						<td width="30%">
							请选择您合适的网上银行
						</td>
					</tr>		
					<tr>
						<td colspan="3">
							<hr class="dotline"></hr>
						</td>
					</tr>
					<tr>
						<td width="30%" style="text-align:right;padding-right:10px;">
							用户名：
						</td>
						<td width="30%">
							<input id="realname" name="realname" value="${user.userName}"/>
						</td>
						<td width="30%">
							您希望我们怎么称呼您
						</td>
					</tr>
					<tr>
						<td width="30%" style="text-align:right;padding-right:10px;">
							身份证：
						</td>
						<td width="30%">
							<input id="idCard" name="idCard" value="${user.idCard}"/>
						</td>
						<td width="30%">
							方便您取票
						</td>
					</tr>
					<tr>
						<td colspan="3">
							<div class="buttonbar"> 
								<div class="btngroup">
									<span class="blue-btn"> <span class="inputbtn"> <span
											class="l"></span> <input type="submit" value='提  交' onclick="orderSubmit()"></input>
									</span> </span>
								</div>
							</div>
						</td>
					</tr>
					</tbody>
			</table>
		</div>
	</div>	
</div>
<!-- end of main content -->
<jsp:include page="footer.jsp" />